package com.yansu.cloud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import com.yansu.cloud.bean.User;

/**
 * 
 * @author 言肃
 * @email yansu_code@126.com
 * @version 1.0
 * @date Jul 23, 2018 6:40:45 PM
 */
@RestController
public class MovieController {

	@Value("${user.userServicePath}")
	private String userServicePath;

	@Autowired
	private RestTemplate restTemplate;

	@GetMapping("/movie/{id}")
	public User findById(@PathVariable Long id) {
		return this.restTemplate.getForObject(this.userServicePath + id, User.class);
	}

}
